/*   time:2019-06-13 20:39:24*/
var e = getApp(),
    s = e.requirejs("core"),
    r = e.requirejs("foxui");
e.requirejs("jquery"), Page({
    data: {
        express: "",
        expresscom: "",
        express_number: ""
    },
    onLoad: function(s) {
        this.setData({
            options: s
        }), e.url(s), this.get_list()
    },
    get_list: function() {
        var r = this;
        void 0 === r.data.options.singlerefund ? s.get("order/express_number", r.data.options, function(e) {
            0 == e.error ? (e.show = !0, r.setData(e)) : s.toast(e.message, "loading")
        }) : s.get("order/single_express_number", r.data.options, function(e) {
            0 == e.error ? (e.show = !0, r.setData(e)) : s.toast(e.message, "loading")
        })
    },
    inputPrickChange: function(e) {
        var s = this.data.express_list,
            r = e.detail.value,
            t = s[r].name,
            a = s[r].express;
        this.setData({
            expresscom: t,
            express: a,
            index: r
        })
    },
    inputChange: function(e) {
        var s = e.detail.value;
        this.setData({
            express_number: s
        })
    },
    back: function() {
        wx.navigateBack()
    },
    submit: function(e) {
        var t = this,
            a = e.currentTarget.dataset.refund,
            i = t.data.express_number,
            n = (a = t.data.options.refundid, t.data.options.id);
        if ("" != i) {
            var o = t.data.express,
                d = t.data.expresscom;
            void 0 === t.data.options.singlerefund ? s.get("order/express_number", {
                submit: 1,
                refundid: a,
                orderid: n,
                express_number: i,
                express: o,
                expresscom: d
            }, function(e) {
                0 == e.error && wx.navigateTo({
                    url: "/pages/order/detail/index?id=" + n
                })
            }) : s.get("order/single_express_number", {
                submit: 1,
                refundid: a,
                orderid: n,
                express_number: i,
                express: o,
                expresscom: d
            }, function(e) {
                0 == e.error && wx.navigateTo({
                    url: "/pages/order/detail/index?id=" + n
                })
            })
        } else r.toast(t, "请填写快递单号")
    }
});